package com.crfchina.feign.eurekafegin.service;

import com.crfchina.feign.eurekafegin.pojo.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("compute-service")
public interface ComputeClient {

    @RequestMapping(method = RequestMethod.GET, value = "/add")
    Integer add(@RequestParam(value = "a") Integer a, @RequestParam(value = "b") Integer b);

    //这里有一个坑:当使用@requestparam  这种可以指定名称的注解的时候,在feign中必须指定参数名称.例如:@requestParam("name")
     @RequestMapping(value = "/user",method = RequestMethod.POST)
    String user(User user);
}